/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 最大;

import java.util.Scanner;

public class Test {
 public static void main(String[] args) {
  Scanner x=new Scanner(System.in);
  System.out.println("输入两个数");
  int a=x.nextInt();
  int b=x.nextInt();
  int s=a<b?a:b;
  for(int i=s;i>=1;i--){
   if(a%i==0&&b%i==0){
    System.out.println(a+","+b+ "的最大公因子是"+i);
    break;
   }
  }
 }
}
